<?php
include "../../Koneksi/koneksi.php";

$kkmPengetahuan = $_POST['kkmPengetahuan'];
$kkmSikap = $_POST['kkmSikap'];
$kkmKetrampilan = $_POST['kkmKetrampilan'];

$cek = mysql_fetch_array(mysql_query("SELECT g.kodeGuruMapel FROM gurumapel g, pendidik p, matapelajaran m "
        . "WHERE g.pendidik=p.nip and g.matapelajaran=m.kodemapel and g.kkmPengetahuan is not null "
        . "and g.pendidik='1122'"));
if (($cek['kodeGuruMapel']!=null)) {
    mysql_query("update gurumapel set kkmPengetahuan = '$kkmPengetahuan' ,kkmSikap ='$kkmSikap', kkmKetrampilan = '$kkmKetrampilan' where pendidik='1122'");
    
    
    $result = header('location:../Form/FormKKM.php');
    
//    echo"$kkmPengetahuan,$kkmSikap,$kkmKetrampilan";
} else {

    ?>
    <script>alert("Data KKM Berhasil diUpdate");
                    document.location.href = "../Form/FormKKM.php"</script>
    <?php
}

?>